#!/usr/bin/env python3

import rospy
from cre.srv import CreServiceMsg


def handle_my_service(req):
    rospy.loginfo("Service request: %d", req.input)
    return req.input * 2  # 返回输出结果


rospy.init_node("my_service_server")
service = rospy.Service("my_service", CreServiceMsg, handle_my_service)
rospy.loginfo("Ready to handle requests")
rospy.spin()
